package com.lcy.enums;

public enum ProblemJudgeResultEnum {

//	ACCEPTED(0, "Accepted"),
//
//	WRONG_ANSWER(1, "Wrong Answer"),
//
//	COMPILE_ERROR(2, "Compile Error"),
//
//	MEMORY_LIMIT_EXCEEDED(3, "out of Memory"),
//
//	TIME_LIMIT_EXCEEDED(4, "Time Limit Exceeded"),
//
//	RUNTIME_ERROR(5, "Runtime Error"),
//
//	SYSTEM_ERROR(6, "System Error");
	ACCEPTED(0, "通过"),
	WRONG_ANSWER(1, "答案错误"),
	COMPILE_ERROR(2, "编译错误"),
	RUNTIME_ERROR(3, "运行时错误"),  // 调整顺序
	TIME_LIMIT_EXCEEDED(4, "时间超限"),
	MEMORY_LIMIT_EXCEEDED(5, "内存超限"),
	SYSTEM_ERROR(6, "系统错误");

	private final Integer key;

	private final String value;

	ProblemJudgeResultEnum(Integer key, String value) {
		this.key = key;
		this.value = value;
	}

	public static ProblemJudgeResultEnum getEnum(Integer key) {
		ProblemJudgeResultEnum[] enums = ProblemJudgeResultEnum.values();
		for (ProblemJudgeResultEnum enumItem : enums) {
			if (enumItem.getKey() == key) {
				return enumItem;
			}
		}
		return null;
	}

	public Integer getKey() {
		return key;
	}

	public String getValue() {
		return value;
	}

}
